<template>
	<view class="main">
		<view class="SearchDiv" v-if="IsRuKu==false">

			<uni-segmented-control :current="current" :values="items" :style-type="styleType"
				:active-color="activeColor" @clickItem="onClickItem" :defaultColor="defaultColor"
				:defaultFontSize='defaultFontSize' />
		</view>
		<view class="MenuDiv" v-if="IsRuKu" style="padding-top: 40rpx;">

			<!-- 			<view class="ItemDiv" @click="ShowMenDianMomo" style="margin-top:-16rpx;">
				<view class="ItemTitle">
					入库门店
				</view>
				<view class="ItemDev" style="max-width: 60vw;">
					{{MenDian}}
				</view>
				<image src="../../static/icons/right.svg" mode="" class="RightImg"></image>
			</view> -->
			<view class="ItemDiv">
				<view class="ItemTitle">
					备注
				</view>
				<uni-easyinput v-model="remark" placeholder="0-50字符"></uni-easyinput>
				<!-- <image src="../../static/icons/right.svg" mode="" class="RightImg"></image> -->
			</view>

			<view class="ItemDiv " style="border-radius: 0;">
				<view class="ItemTitle">
					商品信息
				</view>
				<view class="ItemDev" @click="ClearShangPing" style="color: #3675da;">
					清空商品
				</view>
			</view>
			<view class="ItemDiv " style="height: 112rpx;margin-top: -20rpx;border-radius: 0;">
				<view class="SetShanPingBotton">
					<button class="SetFirstButton" @click="Saoma">
						<image src="../../static/icons/SaoMa.svg" mode="" class="ButtonImage"></image>
						扫码添加
					</button>
					<button class="SetLastButton" @click="NextBuZhou">
						<image src="../../static/icons/Add.svg" mode="" class="ButtonImage"></image>
						添加商品
					</button>
				</view>
			</view>
			<SheZhiZheKou ref="SheZhiZheKou1" :type="'RuKu'"></SheZhiZheKou>
		</view>



		<view class="content" v-if="IsRuKu==false">
			<view v-show="current === 0">
				<view class="MenuDiv">
					<view class="SmallTip">基础设置</view>
					<view class="ItemDiv" @click="ShowHuoDonFanWei">
						<view class="ItemTitle">
							活动类型
						</view>
						<view class="ItemDev">
							{{ HuoDonTip }}
						</view>
						<image src="../../static/icons/right.svg" mode="" class="RightImg"></image>
					</view>

					<!-- 					<view class="SmallTip">基础设置</view>
					<view class="ItemDiv">
						<view class="ItemTitle">
							活动标签
						</view>
						<view class="ItemDev" @click="ShowHuoDonPop">
							{{ HuoDonTip }}
						</view>
						<image src="../../static/icons/right.svg" mode="" class="RightImg"></image>
					</view> -->
					<view class="SmallTip">活动设置</view>
					<view class="ItemDiv">
						<view class="ItemTitle">
							{{ IsCoupons ?"优惠券名称":"活动名称"}}<text style="color: red;">*</text>
						</view>
						<uni-easyinput v-model="ActivityData.activityName"
							:placeholder="IsCoupons ?'请输入优惠券名称':'请输入活动名称'"></uni-easyinput>
						<!-- <image src="../../static/icons/right.svg" mode="" class="RightImg"></image> -->
					</view>
					<view class="ItemDiv" v-if="IsCoupons" style="margin-top:-8px;" @click="ShowMomo2">
						<view class="ItemTitle">
							发放方式<text style="color: red;">*</text>
						</view>
						<view class="ItemDev">
							{{info2==''?'选择发放方式':info2}}
						</view>
						<image src="../../static/icons/right.svg" mode="" class="RightImg"></image>
					</view>

					<view class="ItemDiv" v-if="ShowChonZhi && IsCoupons" style="margin-top:-8px;">
						<view class="ItemTitle">
							充值优惠券赠送门槛
							<text style="color: red;">*</text>
						</view>
						<view class="JinErStart">
							<uni-easyinput v-model="ChonZhiPrice" type="digit" placeholder="请输入金额"></uni-easyinput>
							元
						</view>
					</view>
					<view class="ItemDiv" v-if="IsCoupons" style="margin-top:-8px;">
						<view class="ItemTitle">
							每个用户能领取该优惠券个数
							<text style="color: red;">*</text>
						</view>
						<view class="JinErStart">
							<uni-easyinput v-model="ChonZhiNum" type="digit" placeholder="请输入数量"></uni-easyinput>
							个
						</view>
					</view>



					<view class="ItemDiv" v-if="IsCoupons" style="margin-top:-8px;" @click="toYonQuanTime">
						<view class="ItemTitle">
							用券时间<text style="color: red;">*</text>
						</view>
						<view class="ItemDev">
							{{ YonQuanTimeDesc ==''? '选择用券时间': YonQuanTimeDesc}}
						</view>
						<image src="../../static/icons/right.svg" mode="" class="RightImg"></image>
					</view>


					<view class="ItemDiv" v-if="IsCoupons" style="margin-top:-8px;">
						<view class="ItemTitle">
							发行总量<text style="color: red;">*</text>
						</view>
						<uni-easyinput v-model="FaXinNumber" type="Number" placeholder="请输入发行总量"></uni-easyinput>
						张
					</view>



					<view class="ItemDiv" style="margin-top:-16rpx;" v-if="Isvipactive==false && !IsCoupons">
						<view class="ItemTitle">
							周期活动
						</view>
						<switch color="rgba(54, 152, 252, 1)" @change.stop="ChangeZhouQi($event)"
							style="transform: scale(0.67);width: 82px;" :checked="IsZhouQi" />
					</view>

					<view class="SmallTip" v-if="IsZhouQi">周期设置</view>
					<view class="ItemDiv" v-if="IsZhouQi">
						<view class="ItemTitle">
							周期时间
						</view>
						<view class="ZhouQiTime">
							<view class="ZhouQiStart" @click="showHourClick(1)">
								{{ ZhouQiStart}}
							</view>
							至
							<view class="ZhouQiStart" @click="showHourClick(2)">
								{{ ZhouQiEnd}}
							</view>
						</view>
						<view class="ZhouQiAdd">
							添加
						</view>
						<!-- <image src="../../static/icons/right.svg" mode="" class="RightImg"></image> -->
					</view>
					<view class="ItemDiv" style="margin-top:-16rpx;" v-if="IsZhouQi">
						<view class="ItemTitle">
							周期方式
						</view>
						<hpy-form-select :dataList="SelectZhouQiList" text="text" name="value" v-model="SelectZhouQi"
							title='每周执行' :hideArrow="true" @change="changeSelectZhouQi" />
						<image src="../../static/icons/right.svg" mode="" class="RightImg"></image>
					</view>

					<view class="ItemDiv" @click="showpickerClick" v-if="ShowZhiXinRiQi && IsZhouQi"
						style="margin-top:-16rpx;">
						<view class="ItemTitle">
							执行日期
						</view>
						<view class="ItemDev" v-if="ActivityData.periodDay.length ==0">
							选择日期
						</view>
						<view class="ItemDev" v-else>
							{{ ActivityData.periodDay }}
						</view>

						<image src="../../static/icons/right.svg" mode="" class="RightImg"></image>
					</view>

					<view class="SmallTip">门店设置</view>
					<view class="ItemDiv">
						<view class="ItemTitle">
							活动门店
						</view>
						<view class="ItemDev RadioDev">
							<radio-group @change="radioMenDianChange" class="RadioGroup">
								<label class="radio">
									<radio value="QuanBuMenDian" :checked="!ZhiDinMenDian" color="#1f64ff" />全部门店
								</label>
								<label class="radio">
									<radio value="ZhiDingMenDian" :checked="ZhiDinMenDian" color="#1f64ff" />指定门店
								</label>
							</radio-group>
						</view>
					</view>
					<view class="ItemDiv" v-if="ZhiDinMenDian" @click="ShowMenDianMomo" style="margin-top:-16rpx;">
						<view class="ItemTitle">
							选择门店
						</view>
						<view class="ItemDev" style="max-width: 60vw;">
							{{MenDian}}
						</view>
						<image src="../../static/icons/right.svg" mode="" class="RightImg"></image>
					</view>


					<view class="SmallTip">活动时间</view>
					<view class="ItemDiv">
						<view class="ItemTitle">
							开始时间
						</view>
						<picker mode="date" :value="ActivityData.startTime" @change="DateChange">
							<view class="picker">
								{{ActivityData.startTime}}
							</view>
						</picker>
						<image src="../../static/icons/right.svg" mode="" class="RightImg"></image>
					</view>

					<view class="ItemDiv" style="margin-top:-16rpx;">
						<view class="ItemTitle">
							结束时间
						</view>
						<picker mode="date" :value="ActivityData.endTime" @change="bindDateChange_end">
							<view class="picker">
								{{ActivityData.endTime}}
							</view>
						</picker>
						<image src="../../static/icons/right.svg" mode="" class="RightImg"></image>
					</view>

					<view class="SmallTip"
						v-if="ActivityData.type == 'FullMinusActivity' || ActivityData.type == 'fullFoldActivity' || ActivityData.type == 'BuyActivity'|| ActivityData.type == 'discount' || ActivityData.type == 'offerMinusCoupons' || ActivityData.type == 'offerFoldCoupons'">
						优惠设置</view>

					<view class="ItemDiv" v-if="ShowQCZheKou">
						<view class="ItemTitle">
							参与商品折扣
							<text style="color: red;">*</text>
						</view>
						<view class="JinErStart">
							<uni-easyinput v-model="QCZheKou" type="digit" placeholder="请输入折扣"></uni-easyinput>
							折
						</view>
					</view>
					<view class="ItemDiv" v-if="ShowQCZheKou" style="margin-top:-16rpx;">
						<view class="ItemTitle">
							门槛单位
						</view>
						<hpy-form-select :dataList="SelectDanWeiList" text="text" name="value"
							v-model="SelectYouHuiQuan" title='满指定金额' :hideArrow="true" @change="changeYouHuiQuan" />
						<image src="../../static/icons/right.svg" mode="" class="RightImg"></image>
					</view>
					<view class="ItemDiv" v-if="ShowQCZheKou" style="margin-top:-16rpx;">
						<view class="ItemTitle">
							活动门槛
							<text style="color: red;">*</text>
						</view>
						<view class="JinErStart">
							<uni-easyinput v-model="QCMenKan" type="digit"
								:placeholder="SelectYouHuiQuan == 1?'请输入金额':'请输入件数'"></uni-easyinput>
							{{ SelectYouHuiQuan == 1?'元':'件'}}
						</view>
					</view>


					<view class="ItemDiv"
						v-if="ActivityData.type == 'offerMinusCoupons' || ActivityData.type == 'offerFoldCoupons'">
						<view class="ItemTitle">
							{{ActivityData.type == 'offerMinusCoupons'?'券面金额':'券面折扣'}}<text style="color: red;">*</text>
						</view>
						<uni-easyinput v-model="QuanMianMoney" type="digit"
							:placeholder="ActivityData.type == 'offerMinusCoupons'?'请输入金额':'请输入折扣'"
							@change="ChangeBuyDiscount"></uni-easyinput>
						{{ActivityData.type == 'offerMinusCoupons'?'元':'折'}}
					</view>

					<view class="ItemDiv"
						v-if="ActivityData.type == 'offerMinusCoupons' || ActivityData.type == 'offerFoldCoupons'"
						style="margin-top:-16rpx;">
						<view class="ItemTitle">
							门槛单位
						</view>
						<hpy-form-select :dataList="SelectDanWeiList" text="text" name="value"
							v-model="SelectYouHuiQuan" title='满指定金额' :hideArrow="true" @change="changeYouHuiQuan" />
						<image src="../../static/icons/right.svg" mode="" class="RightImg"></image>
					</view>

					<view class="ItemDiv"
						v-if="ActivityData.type == 'offerMinusCoupons' || ActivityData.type == 'offerFoldCoupons'"
						style="margin-top:-16rpx;">
						<view class="ItemTitle">
							优惠券门槛<text style="color: red;">*</text>
						</view>
						<uni-easyinput v-model="MenKanMoney" type="digit"
							:placeholder="SelectYouHuiQuan == 1?'请输入金额':'请输入件数'"
							@change="ChangeBuyDiscount"></uni-easyinput>
						{{ SelectYouHuiQuan == 1?'元':'件'}}
					</view>


					<view class="ItemDiv" v-if="ActivityData.type == 'BuyActivity'">
						<view class="ItemTitle">
							购买商品数<text style="color: red;">*</text>
						</view>
						<uni-easyinput v-model="BuyNumber" type="digit" placeholder="请输入购买件数"
							@change="ChangeBuyDiscount"></uni-easyinput>
						件
					</view>
					<view class="ItemDiv" v-if="ActivityData.type == 'BuyActivity'" style="margin-top:-8px;"
						@click="toChoiseBuy">
						<view class="ItemTitle">
							选择购买商品<text style="color: red;">*</text>
						</view>
						<view class="ItemDev">
							{{ChoiseBuyGoods.id ==null?'未设置':ChoiseBuyGoods.name}}
						</view>
						<image src="../../static/icons/right.svg" mode="" class="RightImg"></image>
					</view>

					<view class="ItemDiv" v-if="ActivityData.type == 'BuyActivity'">
						<view class="ItemTitle">
							优惠商品数<text style="color: red;">*</text>
						</view>
						<uni-easyinput v-model="YouHuiNumber" type="digit" placeholder="请输入优惠商品数"
							@change="ChangeBuyDiscount"></uni-easyinput>
						件
					</view>
					<view class="ItemDiv" v-if="ActivityData.type == 'BuyActivity'" style="margin-top:-8px;"
						@click="toChoiseSon">
						<view class="ItemTitle">
							选择优惠商品数
						</view>
						<view class="ItemDev">
							{{ChoiseSonGoods.id ==null?'未设置':ChoiseSonGoods.name}}
						</view>
						<image src="../../static/icons/right.svg" mode="" class="RightImg"></image>
					</view>

					<view class="ItemDiv" v-if="ActivityData.type == 'BuyActivity'" style="margin-top:-8px;">
						<view class="ItemTitle">
							打
						</view>
						<uni-easyinput v-model="ZheKouNumber" type="digit" placeholder="请输入折扣数"
							@change="ChangeBuyDiscount"></uni-easyinput>
						折
					</view>

					<view class="ItemDiv" v-if="ActivityData.type == 'BuyActivity'">
						<view class="ItemTitle">
							描述
						</view>
						<view class="ItemDev" style="width: 50%;">
							{{ Buydiscount }}
						</view>
					</view>

					<view class="ItemDiv"
						v-if="ActivityData.type == 'FullMinusActivity' || ActivityData.type == 'fullFoldActivity'"
						@click="ManJianClick">
						<view class="ItemTitle">
							优惠内容<text style="color: red;">*</text>
						</view>
						<view class="ItemDev" v-if="ActivityData.yzsActivityRuleList.length==0">
							未设置
						</view>
						<image src="../../static/icons/right.svg" mode="" class="RightImg"></image>
					</view>

					<view class="ItemDiv"
						v-if="ActivityData.yzsActivityRuleList.length!=0 && (ActivityData.type == 'FullMinusActivity' || ActivityData.type == 'fullFoldActivity')"
						v-for="item in ActivityData.yzsActivityRuleList" style="margin-top:-8px;">
						<view class="ItemTitle">
							优惠层级：{{item.level}}
						</view>
						<view class="ItemDev">
							{{ item.presentType }}
						</view>
					</view>



					<view class="SmallTip">用户设置</view>

					<view class="ItemDiv">
						<view class="ItemTitle">
							优惠对象
						</view>
						<view class="ItemDev RadioDev">
							<radio-group @change="DuiXiangRadio" class="RadioGroup" style="gap: 16rpx;">
								<label class="radio">
									<radio value="all" :checked="ActivityData.target=='all'" color="#1f64ff" />全部用户
								</label>
								<label class="radio">
									<radio value="novip" :checked="ActivityData.target=='novip'" color="#1f64ff" />非会员
								</label>
								<label class="radio">
									<radio value="vip" :checked="ActivityData.target=='vip'" color="#1f64ff" />会员
								</label>
							</radio-group>
						</view>
					</view>

					<view class="ItemDiv" style="margin-top:-16rpx;" v-if="ActivityData.target!='novip'">
						<view class="ItemTitle">
							会员积分
						</view>
						<view class="ItemDev RadioDev">
							<radio-group @change="JiFenRadio" class="RadioGroup">
								<label class="radio">
									<radio value="1" :checked="ActivityData.earnPoints=='1'" color="#1f64ff" />积分
								</label>
								<label class="radio">
									<radio value="0" :checked="ActivityData.earnPoints=='0'" color="#1f64ff" />不计分
								</label>
							</radio-group>
						</view>
					</view>

					<view class="ItemDiv" v-if="Isvipactive && ActivityData.target!='novip'" style="margin-top:-16rpx;">
						<view class="ItemTitle">
							金额积分比<text style="color: red;">*</text>
						</view>
						<view class="JinErTime">
							<view class="JinErStart">
								<uni-easyinput v-model="VipMoney" type="digit" placeholder="请输入金额"></uni-easyinput>
								(元)
							</view>
							比
							<view class="JinErStart">
								<uni-easyinput v-model="VipFen" type="digit" placeholder="请输入积分"></uni-easyinput>
								(积分)
							</view>
						</view>
						<!-- <image src="../../static/icons/right.svg" mode="" class="RightImg"></image> -->
					</view>
					<!-- 					<view class="ItemDiv" style="margin-top:-16rpx;" v-if="IsDiErJian==false">
						<view class="ItemTitle">
							优惠限购
						</view>
						<view class="ItemDev" @click="ShowYouHuiXianGou">
							{{YouHuiXianGou}}
						</view>
						<image src="../../static/icons/right.svg" mode="" class="RightImg"></image>
					</view> -->
					<view class="SmallTip">
						{{ IsCoupons ?"券备注":"活动简介"}}
					</view>

					<view class="ItemDiv" style="height: auto;">
						<uni-easyinput type="textarea" v-model="ActivityData.note"
							:placeholder="IsCoupons?'请输入券备注':'请输入活动简介'"></uni-easyinput>
					</view>

					<view class="SmallTip">提醒设置</view>

					<view class="ItemDiv">
						<view class="ItemTitle">
							活动到期前短信免费提醒我
						</view>
						<switch :checked="item.storeState" color="rgba(77, 216, 101, 1)"
							@change.stop="ChangeisOnline($event,item)" style="transform: scale(0.67);width: 72px;" />
					</view>
				</view>
			</view>

			<view v-show="current === 1">

				<view class="SetShanPingDiv">

					<view class="ItemDiv SetShanPing" v-if="ActivityData.type == 'offerCoinCoupons'">
						<view class="ItemTitle">
							兑换数量
							<text style="color: red;">*</text>
						</view>
						<view class="JinErStart">
							<uni-easyinput v-model="DuiHuanNumber" type="digit" placeholder="请输入兑换数量"></uni-easyinput>
							个
						</view>
					</view>

					<!--  兑换券选择商品 -->
					<view class="ItemDiv SetShanPing" v-if="ActivityData.type == 'offerCoinCoupons'" @click="toDuiHuan">
						<view class="ItemTitle">
							兑换商品<text style="color: red;">*</text>
						</view>
						<view class="ItemDev">
							选择兑换商品
						</view>
						<image src="../../static/icons/right.svg" mode="" class="RightImg"></image>
					</view>
					<!-- 					<view class="ItemDiv" v-if="ActivityData.type == 'offerCoinCoupons'" style="margin-top:-16rpx;"
						v-for="(item,index) in DuiHuanGoods">
						<view class="ItemTitle">
							兑换商品{{index+1}}
						</view>
						<view class="ItemDev">
							{{item.name}}
						</view>
						 <image src="../../static/icons/right.svg" mode="" class="RightImg"></image> 
					</view>-->



					<view class="ItemDiv SetShanPing" v-if="ShowJoin">
						<view class="ItemTitle">
							参与商品
						</view>
						<hpy-form-select :dataList="SelectJoinList" text="text" name="value" v-model="SelectJoin"
							title='全部商品' :hideArrow="true" @change="changeSelectJoin" />
						<image src="../../static/icons/right.svg" mode="" class="RightImg"></image>
					</view>

					<view class="ItemDiv SetShanPing" v-if="ShowFenLei" @click="ShowMomo">
						<view class="ItemTitle">
							选择分类
						</view>
						<view class="ItemDev" style="max-width: 60vw;">
							{{info}}
						</view>
						<image src="../../static/icons/right.svg" mode="" class="RightImg"></image>
					</view>

					<view class="ItemDiv SetShanPing" v-if="ShowNOJoin">
						<view class="ItemTitle">
							不参与商品
						</view>
						<hpy-form-select :dataList="SelectNoJoinList" text="text" name="value" v-model="SelectJoin1"
							title='无' :hideArrow="true" @change="changeSelectJoin1" />
						<image src="../../static/icons/right.svg" mode="" class="RightImg"></image>
					</view>
					<view class="ItemDiv SetShanPing" v-if="ShowFenLei1" @click="ShowMomo1">
						<view class="ItemTitle">
							选择分类
						</view>
						<view class="ItemDev" style="max-width: 60vw;">
							{{info1}}
						</view>
						<image src="../../static/icons/right.svg" mode="" class="RightImg"></image>
					</view>

					<view class="ItemDiv SetShanPing" v-if="ZhiDingShangPing == true">
						<view class="ItemTitle">
							商品信息
						</view>
						<view class="ItemDev" @click="ClearShangPing" style="color: #3675da;">
							清空商品
						</view>
					</view>

					<view class="ItemDiv SetShanPing" v-if="ZhiDingShangPing == true" style="height: 112rpx;">
						<view class="SetShanPingBotton">
							<button class="SetFirstButton" @click="Saoma">
								<image src="../../static/icons/SaoMa.svg" mode="" class="ButtonImage"></image>
								扫码添加
							</button>
							<button class="SetLastButton" @click="NextBuZhou">
								<image src="../../static/icons/Add.svg" mode="" class="ButtonImage"></image>
								添加商品
							</button>
						</view>
					</view>
					<SheZhiZheKou v-if="ShowNOJoin == false" ref="SheZhiZheKou" :type="ActivityData.type">
					</SheZhiZheKou>

					<SheZhiZheKou v-if="ShowSheZhiZheKou" ref="SheZhiZheKou" :type="ActivityData.type"></SheZhiZheKou>

					<!-- 					<SheZhiZheKou v-if="ActivityData.type == 'offerCoinCoupons'" ref="SheZhiZheKou"
						:type="ActivityData.type">
					</SheZhiZheKou> -->

				</view>
			</view>
		</view>

		<view class="OutLogin" v-if="ShowPiLiang == false">

			<!-- 			<button type="default" class="CanCelButton" @click="PiLiangButton" style="margin-left: 2vw;"
				v-if="ShowNOJoin == false">批量修改</button> -->

			<button type="default" class="CanCelButton" @click="Back">取消</button>
			<button type="default" class="OutLoginButton1" @click="saveList">保存</button>
		</view>

		<!-- 普通弹窗 -->
		<uni-popup ref="popup" background-color="#fff">
			<view class="PopItem" v-for="item in PopList" @click="ChangePop(item)" :key="item.id">
				{{item.name}}
			</view>

			<view class="PopCancel" @click="PopCancel">
				取消
			</view>
		</uni-popup>
		<multiple-select v-model="show" :data="list" @confirm="confirm"></multiple-select>
		<multiple-select v-model="show1" :data="list1" @confirm="confirm1"></multiple-select>
		<multiple-select v-model="showMenDian" :data="MenDianlist" @confirm="confirmMenDian"></multiple-select>

		<uni-popup ref="popup3" background-color="#fff">
			<!-- 选择用券时间 -->
			<view class="PopDiv">
				<view class="PopTitle">
					用券时间
				</view>
				<view class="PopCenterDiv">
					<radio-group @change="YonQuanTimeRadio" class="RadioGroup2">
						<label class="radio1">
							<radio value="1" :checked="YonQuanTime=='1'" color="#1f64ff" />活动时间内可用
						</label>
						<label class="radio1">
							<radio value="0" :checked="YonQuanTime=='0'" color="#1f64ff" />
							<view class="radioItemDiv">领取后 <input type="digit" class="RadioInput"
									v-model="LinQuHouTime">
								天内可用
							</view>
						</label>
						<label class="radio1">
							<radio value="2" :checked="YonQuanTime=='2'" color="#1f64ff" />
							<view class="radioItemDiv">
								<text>领取后等待</text> <input type="digit" class="RadioInput" v-model="LinQuHouWaitTime">
								<text>天可用</text>
							</view>
						</label>
						<view class="radio1">
							<text>有效期</text> <input type="digit" class="RadioInput"
								v-model="YouXiaoQiTime"><text>天</text>
						</view>
					</radio-group>
				</view>

				<view class="PopButtonDiv">
					<view class="PopButton" style="border-right: 2rpx solid #e4e6e5;" @click="Pop3Cancel">
						取消
					</view>
					<view class="PopButton" @click="Pop3QueDing">
						确定
					</view>
				</view>
			</view>
		</uni-popup>

		<!--  优惠券领取方式 -->
		<multiple-select v-model="show2" :data="list2" @confirm="confirm2"></multiple-select>

		<!-- 活动标签 -->
		<uni-popup ref="popup2" background-color="#fff" @change="change">
			<view class="Pop2Index">
				<view class="PopItem2">
					<view class="PopItem2Title">
						热门标签
					</view>
					<view class="PopItemTipDiv">
						<view class="PopItemTip">
							优惠促销
						</view>
						<view class="PopItemTip">
							促销活动
						</view>
					</view>
				</view>
			</view>
		</uni-popup>

		<!-- 星期日期选择器 -->
		<jsfun-picker mess="请选择日期" ref="picker" :listArr="priceList" :defaultArr="priceDefault" type="multiple"
			v-model="showpicker" @click="priceChange">
			<!-- 自定义页面显示元素 -->

		</jsfun-picker>

		<!-- 小时分钟选择器 -->
		<xp-picker ref="Hourpicker" @confirm="Hourconfirm1" mode="hi" :value="ZhouQiStart" />
		<xp-picker ref="Hourpicker1" @confirm="Hourconfirm2" mode="hi" :value="ZhouQiEnd" />

		<uni-popup ref="popup1" background-color="#fff">
			<view class="PopIndex1">
				<view class="PopItem" v-for="item in Pop1List" @click="ChangePop1(item)" :key="item.id">
					{{item.name}}
				</view>
			</view>
			<view class="PopCancel" @click="Pop1Cancel">
				取消
			</view>
		</uni-popup>
	</view>
</template>

<script>
	import SheZhiZheKou from './NextBuZhou/SheZhiZheKou.vue'
	import multipleSelect from "@/components/momo-multipleSelect/momo-multipleSelect.vue";
	import jsfunPicker from '@/components/jsfun-picker/jsfun-picker.vue';
	export default {
		components: {
			SheZhiZheKou,
			multipleSelect,
			jsfunPicker,
		},
		data() {
			const currentDate = this.getDate({
				format: true
			})
			const currentDate_end = this.getDate_end({
				format: true
			})
			return {
				ShowChonZhi: "",
				ChonZhiPrice: "",
				ChonZhiNum: 1,

				countSave: 0,

				IsCoupons: false, // 是否是优惠劵
				YonQuanTime: 1, // 用券时间
				LinQuHouTime: "", // 优惠券领取后 n 天可用
				LinQuHouWaitTime: "", // 优惠券领取等待 n 天可用
				YouXiaoQiTime: "", // 优惠券有效期  n 天
				YonQuanTimeDesc: "", // 选择用券时间说明
				FaXinNumber: "", // 发行数量
				MenKanMoney: "", // 优惠券门槛
				QuanMianMoney: "", // 优惠券 的券面金额/ 折扣
				FaFanType: "", // 优惠券发放方式
				DuiHuanNumber: 0, // 兑换数量


				BuyNumber: '', //买送活动，输入买n件
				ZheKouNumber: '', // 买送活动，输入折扣数
				ChoiseBuyGoods: {
					name: ''
				}, // 买送活动选择的商品
				ChoiseSonGoods: {
					name: ''
				}, // 买送活动送的商品
				YouHuiNumber: '', // 优惠商品数
				Buydiscount: '买n件a商品，m件b商品打s折',

				QCZheKou: null,
				QCMenKan: null,
				ActivityData: {
					note: "",
					storeId: "",
					type: "", // 表示活动类型大类，例如 "vip_active" 表示会员活动
					discount: "", // 表示优惠方式，例如 "Full_amount" 表示满额满减
					startTime: currentDate, // 活动开始和结束时间
					endTime: currentDate_end,
					target: "all", // 表示优惠对象，可以是 "all"（所有人）、"vip"（会员）或 "unvip"（非会员）。
					periodic: "0", // 表示是否开启周期活动，0:否，1：是
					periodType: "", // 表示周期方式，例如按天、按周、按月等
					periodStartTime: "", // 表示周期开始和结束时间
					periodEndTime: "",
					periodDay: "", // 记录周期活动指定的日份或星期的天数

					earnPoints: "1", // 表示会员是否获得积分的标识，0:否，1：是
					activityName: "", // 用于记录活动的名称或标题 
					yzsActivityRuleList: [], // 满额满减列表
					joinType: "all", // 可参与类型
					joinList: "", // 可参与列表
					unjoinType: "none", // 不可参与类型
					unjoinList: "", // 不可参与列表
				},
				VipMoney: 1,
				VipFen: 1,
				ActivityRule: {
					thresholdUnit: '', //满额单位：记录满额的单位，如 "额" 或 "件
					operationType: '', // 操作类型: 表示操作类型，如减（满减）、折（满折）或增（满赠）
					ruleField: '', //  规则字段：记录具体的规则字段，如 "10:10" 表示满10加10分
					level: '', // 层级：表示第几层级
				},

				remark: '',
				IsZhouQi: false,
				ShowZhiXinRiQi: false,
				SelectZhouQiList: [{
						text: '每天执行',
						name: '每天执行',
						value: 1,
					},
					{
						text: '每周执行',
						name: '每周执行',
						value: 2,
					},
					{
						text: '每月执行',
						name: '每月执行',
						value: 3,
					},
				],
				SelectZhouQi: '1', // 当前选择周期方式
				ZhouQiStart: "00:00", // 周期时间起始时间
				ZhouQiEnd: '23:59', // 周期时间结束时间

				showpicker: false,
				priceList: [],
				priceDefault: null,

				ZhiDinMenDian: true, // 指定门店
				ShowFenLei1: false,
				ShowFenLei: false, // 分类多选
				showMenDian: false, // 门店多选
				ShowJoin: true, //参与商品
				ShowQCZheKou: false, // 全场折扣
				ShowSheZhiZheKou: false, // 

				show: false, //是否显示 - 双向绑定
				show1: false, //是否显示 - 双向绑定
				show2: false, //是否显示 - 双向绑定
				info: "",
				info1: "",
				info2: "",
				MenDian: "",

				list: [], //数据源
				MenDianlist: [], //数据源
				SelectMenDianIdList: [], // 选择的门店id列表
				list1: [], //数据源
				list2: [{
						"value": "AfterLogin",
						"label": "注册后发送",
					},
					{
						"value": "intoMiniProgram",
						"label": "进入小程序就发送",
					},
					{
						"value": "AfterOpenDoor",
						"label": "开门后发送",
					},
					{
						"value": "AfterBecameVIP",
						"label": "成为会员后发送",
					},
					{
						"value": "AfterVipConsume",
						"label": "会员消费后发送",
					},
					{
						"value": "AfterScanCode",
						"label": "扫码、分享群领取",
					},
					{
						"value": "AfterRecharge",
						"label": "充值后赠送",
					},
				], //数据源


				ZhiDingShangPing: false,
				ShowPiLiang: false,
				SelectJoin: '',
				SelectYouHuiQuan: 1, // 优惠券门槛单位
				SelectJoin1: '',
				SelectNoJoinList: [{
						text: '无',
						name: '无',
						value: 1,
					},
					{
						text: '指定分类',
						name: '指定分类',
						value: 2,
					},
					{
						text: '指定商品',
						name: '指定商品',
						value: 3,
					},
				],
				SelectJoinList: [{
						text: '全部商品',
						name: '全部商品',
						value: 1,
					},
					{
						text: '指定分类',
						name: '指定分类',
						value: 2,
					},
					{
						text: '指定商品',
						name: '指定商品',
						value: 3,
					},
				],
				SelectDanWeiList: [{
						text: '满指定金额',
						name: '满指定金额',
						value: 1,
					},
					{
						text: '满指定件数',
						name: '满指定件数',
						value: 2,
					},
				],

				defaultFontSize: '30rpx',
				colorIndex: 0,
				activeColor: 'white',
				current: 0,
				styleType: 'text',
				items: ['基础信息', '商品设置'],
				searchValue: '',
				defaultColor: 'white',

				YouHuiNeiRong: '未设置',

				HuoDonTip: '优惠促销',
				YouHuiXianGou: '',
				IsDiErJian: false,
				IsManJian: false,
				Isvipactive: false,
				Pop1List: [],
				PopList: [{
						name: '不限购',
						id: 1
					},
					{
						name: '首件优惠',
						id: 2
					},
					{
						name: '限购',
						id: 3
					}
				],
				imageStyles: {
					width: 264,
					height: 264,
				},
				HavePng: true,
				showXuanZe: false,
				ShowNOJoin: true,
				image: [],
				range: [],
				form: {},
				platformGoodsId: '',
				barcode: '',
				IsTianJia: true,
				IsRuKu: false,


			}
		},


		mounted() {
			uni.$on("SetyzsActivityRuleList", (data) => {
				this.ActivityData.yzsActivityRuleList = data
			})

			uni.$on("toChoiseBuyList", (data) => {
				this.ChoiseBuyGoods = data[0]
				this.ChangeBuyDiscount()
			})

			uni.$on("toChoiseSonList", (data) => {
				this.ChoiseSonGoods = data[0]
				this.ChangeBuyDiscount()
			})
			// this.queryGoodsByBarcode("test2(该字段不能重复)")
			// uni.$on("SetYiXuanList",(data)=>{
			// 	console.log(data);
			// 	this.ShanPinList = data
			// })
		},
		provide() {
			return {
				CancelPiLiangButton: this.CancelPiLiangButton,
			};
		},
		onLoad(option) {
			this.MenDianlist = []
			let a = uni.getStorageSync("MenDianList")
			a.forEach(i => {
				i.value = i.id
				i.label = i.name
				this.MenDianlist.push(i)
			})
			this.goodsTypeQuery()

			this.ToOption(option.name, option.TipName)


			if (option.type == "RuKu") {
				this.IsRuKu = true
				uni.setNavigationBarTitle({
					title: '新建入库单'
				});
			}



			this.ActivityData.storeId = uni.getStorageSync("SelectMenDian")
			let MenDianObj = uni.getStorageSync("MenDianList")
			this.SelectMenDianIdList.push(this.ActivityData.storeId)


			if (option.type == "edit") {
				let id = option.id
				this.details(id)
			} else {
				MenDianObj.forEach(item => {
					if (uni.getStorageSync("SelectMenDian") == item.id) {
						this.MenDian = item.name
					}
				})
			}
			// this.active = 0;
			// this.getAllOrderList(); // 获取订单
		},
		methods: {
			Pop3Cancel() {
				this.$refs.popup3.close()
			},
			Pop3QueDing() {

				this.$refs.popup3.close()
				console.log(this.YonQuanTime);
				if (this.YonQuanTime == 1) {
					// 指定时间可用
					this.YonQuanTimeDesc = "活动时间内可用"
				} else if (this.YonQuanTime == 2) {
					this.YonQuanTimeDesc = "领取后等待" + this.LinQuHouWaitTime + "天可用，有效期" + this.YouXiaoQiTime + "天"
					this.LinQuHouTime = ""
				} else if (this.YonQuanTime == 0) {
					this.YonQuanTimeDesc = "领取后" + this.LinQuHouTime + "天内可用"
					this.LinQuHouWaitTime = ""
					this.YouXiaoQiTime = ""
				}
			},
			toYonQuanTime() {
				this.$refs.popup3.open()
			},
			ChangeBuyDiscount() {
				this.Buydiscount = "买" + this.BuyNumber + "件" + this.ChoiseBuyGoods.name + "，" + this.YouHuiNumber + "件" +
					this.ChoiseSonGoods.name + "打" + this.ZheKouNumber + "折"
				this.$forceUpdate()
			},
			toChoiseBuy() {
				uni.navigateTo({
					url: "/pages/promotion/NextBuZhou/NextBuZhou?type=toChoiseBuy",
				})
			},
			toDuiHuan() {
				uni.navigateTo({
					url: "/pages/promotion/NextBuZhou/NextBuZhou?type=toDuiHuan",
				})
			},
			toChoiseSon() {
				uni.navigateTo({
					url: "/pages/promotion/NextBuZhou/NextBuZhou?type=toChoiseSon",
				})
			},
			formatRule(val) {
				let a = ''
				if (val == 'vip_active') {
					a = '会员活动'
				}
				if (val == 'specialActivity') {
					a = '特价活动'
				}
				if (val == 'discount') {
					a = '折扣活动'
				}
				if (val == 'offerCoinCoupons') {
					a = '兑换券'
				}
				if (val == 'offerFoldCoupons') {
					a = '折扣券'
				}
				if (val == 'offerMinusCoupons') {
					a = '满减券'
				}
				if (val == 'FullMinusActivity') {
					a = '满减活动'
				}
				if (val == 'fullFoldActivity') {
					a = '满折活动'
				}
				if (val == 'BuyActivity') {
					a = '第n件促销'
				}
				return a
			},
			details(id) {
				let url = this.$api.Activity + '/' + id
				this.$request(url, null, "GET", false).then(res => {
					uni.hideLoading();
					if (res.code == '0') {
						this.ActivityData = res.data.desc
						this.HuoDonTip = this.formatRule(this.ActivityData.type)

						if (res.data.desc.periodic == '1') {
							this.IsZhouQi = true

							this.ZhouQiStart = res.data.desc.periodStartTime.substring(0, res.data.desc
								.periodStartTime.lastIndexOf(":"));
							this.ZhouQiEnd = res.data.desc.periodEndTime.substring(0, res.data.desc.periodEndTime
								.lastIndexOf(":"));

							if (res.data.desc.periodType == 'month')
								this.SelectZhouQi = 3
							if (res.data.desc.periodType == 'week')
								this.SelectZhouQi = 2
							if (res.data.desc.periodType == 'day')
								this.SelectZhouQi = 1
							this.changeSelectZhouQi()
						}



						if (res.data.desc.type == "vip_active") {

							this.ActivityRule = res.data.data[0]
							this.ActivityData.yzsActivityRuleList = []
							let list = this.ActivityRule.ruleField.split(":")
							this.VipMoney = list[0]
							this.VipFen = list[1]
						} else {
							this.ActivityData.yzsActivityRuleList = res.data.data
						}

						if (res.data.desc.type == "BuyActivity") {
							this.Buydiscount = res.data.data[0].presentType
							this.ZheKouNumber = Number(res.data.data[0].operationType) * 10
							let list = res.data.data[0].ruleField.split(":")
							this.BuyNumber = list[0]
							this.YouHuiNumber = list[1]

							this.queryGoodsByBarcode(res.data.data[0].presentId, 4)
							this.queryGoodsByBarcode(res.data.data[0].thresholdUnit, 3)
						}

						if (res.data.desc.type == "discount") {
							this.QCZheKou = Number(this.ActivityData.discount) * 10
							this.QCMenKan = res.data.data[0].ruleField
							if (res.data.data[0].thresholdUnit == "满额") {
								this.SelectYouHuiQuan = 1
							} else {
								this.SelectYouHuiQuan = 2
							}

						}

						if (res.data.desc.type == "offerFoldCoupons" || res.data.desc.type ==
							"offerMinusCoupons" || res.data.desc.type == "offerCoinCoupons") {
							this.YonQuanTimeDesc = res.data.data[0].presentType

							this.FaFanType = res.data.desc.discount
							if (this.FaFanType.indexOf("AfterRecharge") != -1) {
								this.ShowChonZhi = true
								this.ChonZhiPrice = res.data.desc.periodType
							}
							let FafanString = ""
							const idArray = res.data.desc.discount.split(",");
							const nameArray = [];

							for (let i = 0; i < idArray.length; i++) {
								const id = idArray[i];
								const item = this.list2.find((element) => element.value == id);
								console.log(id);

								if (item) {
									nameArray.push(item.label);
								} else {
									nameArray.push("Unknown");
								}
							}

							this.info2 = nameArray.join(",")
							this.FaXinNumber = res.data.data[0].level
							this.SelectMenDianIdList = JSON.parse(JSON.stringify(res.data.desc.periodDay)).split(
								",")
							this.MenDian = JSON.parse(JSON.stringify(res.data.desc.createdBy))
							this.ChonZhiNum = JSON.parse(JSON.stringify(res.data.desc.updateBy))
							this.ActivityData.periodDay = ''
							this.ActivityData.createBy = ''

							let listR2 = res.data.data[0].ruleField.split(":")
							if (res.data.data[0].operationType == "减") {
								this.QuanMianMoney = listR2[1]
								this.MenKanMoney = listR2[0]

							} else {
								this.QuanMianMoney = listR2[1] * 10
								this.MenKanMoney = listR2[0]
							}
							if (res.data.data[0].thresholdUnit == '满件') {
								this.SelectYouHuiQuan = 2
							} else {
								this.SelectYouHuiQuan = 1
							}


							if (res.data.desc.type == "offerCoinCoupons") {
								this.DuiHuanNumber = res.data.data[0].ruleField

								let array1 = res.data.data[0].operationType.split(",")
								array1.forEach(item => {
									this.queryGoodsByBarcode(item, 1)
								})

							}

							let persentIdString = res.data.data[0].presentId

							if (persentIdString.includes("&")) {
								this.YonQuanTime = 0
								let persentIdList1 = persentIdString.split("&")
								this.YonQuanTime = persentIdList1[0]

								if (persentIdString.includes(":")) {
									this.YonQuanTime = 2
									let persentIdList2 = persentIdList1[1].split(":")
									this.LinQuHouWaitTime = persentIdList2[0]
									this.YouXiaoQiTime = persentIdList2[1]
								} else {
									this.LinQuHouTime = persentIdList1[1]
								}

							} else {
								this.YonQuanTime = 1
								this.YonQuanTime = persentIdString
							}


						}

						if (this.ActivityData.joinType == 'id') {
							this.SelectJoin = 3
							this.ZhiDingShangPing = true
							this.ShowNOJoin = false

							if (this.ActivityData.type == "specialActivity") {
								this.ActivityData.yzsActivityRuleList.forEach(item => {
									this.queryGoodsByBarcode(item.presentId, 1, item.ruleField)
								})

							} else {
								let array1;
								if (this.ActivityData.joinList.includes(",")) {
									array1 = this.ActivityData.joinList.split(",");
									array1.forEach(item => {
										this.queryGoodsByBarcode(item, 1)
									})
								} else {
									this.queryGoodsByBarcode(this.ActivityData.joinList, 1)
								}


							}
						}
						if (this.ActivityData.joinType == 'type') {
							this.ShowFenLei = true
							this.SelectJoin = 2

							const idArray = this.ActivityData.joinList.split(",");
							const nameArray = [];

							for (let i = 0; i < idArray.length; i++) {
								const id = idArray[i];
								const item = this.list.find((element) => element.value == id);
								console.log(id);

								if (item) {
									nameArray.push(item.label);
								} else {
									nameArray.push("Unknown");
								}
							}
							this.info = nameArray.join(",")
						}

						if (this.ActivityData.unjoinType == 'id') {
							this.SelectJoin1 = 3
							this.ZhiDingShangPing = true
							this.ShowSheZhiZheKou = true
							let array1;
							if (this.ActivityData.unjoinList.includes(",")) {
								array1 = this.ActivityData.unjoinList.split(",");
								array1.forEach(item => {
									this.queryGoodsByBarcode(item, 1)
								})
							} else {
								this.queryGoodsByBarcode(this.ActivityData.unjoinList, 1)
							}


						}
						if (this.ActivityData.unjoinType == 'type') {
							this.SelectJoin1 = 2
							this.ShowFenLei1 = true

							const idArray = this.ActivityData.unjoinList.split(",");
							const nameArray = [];

							for (let i = 0; i < idArray.length; i++) {
								const id = idArray[i];
								const item = this.list.find((element) => element.value == id);

								if (item) {
									nameArray.push(item.label);
								} else {
									nameArray.push("Unknown");
								}
							}
							this.info1 = nameArray.join(",")
						}

					} else {

						uni.showToast({
							title: res.message,
							icon: 'error'
						});
					}

				})
			},
			ToOption(value, name) {
				this.ActivityData.yzsActivityRuleList = []
				this.ActivityData.type = value

				this.IsCoupons = false
				this.ZhiDinMenDian = true // 指定门店
				this.ShowFenLei1 = false
				this.ShowFenLei = false // 分类多选
				this.showMenDian = false // 门店多选
				this.ShowJoin = true //参与商品
				this.ShowQCZheKou = false // 全场折扣
				this.ShowSheZhiZheKou = false // 
				this.ZhiDingShangPing = false
				this.ShowPiLiang = false
				this.IsDiErJian = false
				this.IsManJian = false
				this.Isvipactive = false
				this.ActivityData.joinType = "all"
				this.ActivityData.joinList = ""
				this.ActivityData.unjoinType = "none"
				this.ActivityData.unjoinList = ""


				if (value == 'vip_active') {
					this.YouHuiXianGou = '不限购'
					this.Isvipactive = true
					this.ActivityData.target = 'vip'
				}
				if (this.ActivityData.type == "offerMinusCoupons" || this.ActivityData.type ==
					"offerFoldCoupons" ||
					this
					.ActivityData.type == "offerCoinCoupons") {
					this.IsCoupons = true
					uni.setNavigationBarTitle({
						title: '新建优惠券'
					});
					this.Isvipactive = false


				}

				if (this.ActivityData.type == "specialActivity") {
					this.ShowJoin = false
					this.ShowNOJoin = false
					this.ZhiDingShangPing = true
					this.ActivityData.joinType = "id" // 特价活动只选参与的商品
				}

				if (this.ActivityData.type == "discount") {
					this.ShowJoin = true
					this.ShowNOJoin = true
					this.ZhiDingShangPing = true
					this.ShowQCZheKou = true
				}
				if (this.ActivityData.type == "FullMinusActivity" || this.ActivityData.type ==
					"fullFoldActivity") {
					this.IsManJian = true
				}
				if (this.ActivityData.type == "offerCoinCoupons") {
					this.ShowJoin = false
					this.ShowNOJoin = false
					this.ZhiDingShangPing = true
				}

				if (name) {
					this.HuoDonTip = name
				}

				if (this.HuoDonTip == '第二件半价') {
					this.BuyNumber = 2
					this.ZheKouNumber = 5
					this.YouHuiNumber = 1
					this.ChangeBuyDiscount()
				}
				if (this.HuoDonTip == '买一送一') {
					this.BuyNumber = 2
					this.ZheKouNumber = 0
					this.YouHuiNumber = 1
					this.ChangeBuyDiscount()
				}
				this.$forceUpdate()

			},
			Saoma() { //扫码验证
				// this.queryGoodsByBarcode('6957809511708')

				uni.scanCode({
					// 　　　　  onlyFromCamera: true, //为true只允许相机扫码，不加允许相册扫码
					success: (res) => {
						this.queryGoodsByBarcode(res.result, 2)
					},
					fail: (err) => {
						console.log('扫码失败', err)
						if (err.errMsg == 'scanCode:fail cancel') {
							uni.showToast({
								title: "取消扫码",
								icon: 'none'
							});
						}
					}
				})
			},
			queryGoodsByBarcode(code, num, ruleField) {
				let url;
				if (num == 1 || num == 3 || num == 4)
					url = this.$api.queryStoreGoodsById + '?id=' + code + '&store=' + uni.getStorageSync(
						"SelectMenDian")
				else
					url = this.$api.queryStoreGoodsByBarcode + '?barcode=' + code + '&store=' + uni.getStorageSync(
						"SelectMenDian")
				this.$request(url, null, "POST", false).then(res => {

					if (res.code == '0' && res.data != null) {
						// let ShanPinList = this.$refs.SheZhiZheKou1.getShanPinList()
						if (res.data.costPrice)
							res.data.JinHuoJia = res.data.costPrice
						res.data.LinSouJia = res.data.salePrice
						res.data.RuKuNum = 0
						let a = []
						if (ruleField) {

							res.data.JinHuoJia = (Number(res.data.salePrice) * Number(ruleField)).toFixed(
								2)
							res.data.LinSouJia = Number(ruleField) * 10 // 折扣
							res.data.RuKuNum = (Number(res.data.salePrice) * Number(ruleField)).toFixed(2)
						}


						this.ActivityData.yzsActivityRuleList.forEach(item => {

							if (item.presentId == res.data.id) {
								res.data.relatedId = item.relatedId
								res.data.ruleId = item.ruleId
							}
						})

						a.push(res.data)
						// ShanPinList.unshift(res.data)
						console.log(222, a)


						if (this.IsRuKu)
							uni.$emit("SetYiXuanList", a)
						else {
							uni.$emit("SetYiXuanList2", a)
						}

						if (num == 2)
							uni.showToast({
								title: '扫码成功'
							})

						if (num == 3) {
							this.ChoiseBuyGoods = res.data
						}
						if (num == 4) {
							this.ChoiseSonGoods = res.data
						}

					} else {
						if (num == 2)
							uni.showToast({
								title: "未查到该商品",
								icon: 'none'
							});
					}
				})
			},
			Back() {
				uni.navigateBack()
			},
			ClearShangPing() {
				try {
					this.$refs.SheZhiZheKou1.setShanPinList([])
				} catch (e) {
					//TODO handle the exception
				}
				try {
					this.$refs.SheZhiZheKou.setShanPinList([])
				} catch (e) {
					//TODO handle the exception
				}
			},
			ChangeZhouQi(event) {
				this.IsZhouQi = event.detail.value
				if (this.IsZhouQi) {
					this.ActivityData.periodic = '1'
					this.ActivityData.periodStartTime = this.ZhouQiStart
					this.ActivityData.periodEndTime = this.ZhouQiEnd
					this.ActivityData.periodType = "day"
				} else
					this.ActivityData.periodic = '0'
			},
			showpickerClick() { // 星期日期选择
				this.$refs.picker.showPicker()
			},
			showHourClick(type) {
				if (type == 1) {
					this.$refs.Hourpicker.show()
				} else {
					this.$refs.Hourpicker1.show()
				}
			},
			priceChange(data) {
				console.log("==星期日期选择返回值==");
				console.log(data);
				console.log(data.indexStr);
				console.log(data.textStr);

				let numbers = data.indexStr.split(","); // 将字符串拆分为数字数组
				let incrementedNumbers = numbers.map((num) => parseInt(num) + 1); // 遍历数组并加1
				let incrementedString = incrementedNumbers.join(","); // 将数组重新组合为字符串

				this.ActivityData.periodDay = incrementedString
				this.priceDefault = incrementedString
			},
			Hourconfirm2(e) {
				this.ZhouQiEnd = e
				this.ActivityData.periodEndTime = this.ZhouQiEnd
			},
			Hourconfirm1(e) {
				this.ZhouQiStart = e
				this.ActivityData.periodStartTime = this.ZhouQiStart
				console.log('ZhouQiStart', e)
			},
			saveList() {
				if (this.IsRuKu) {
					this.IsRuKuReq()
				} else if (this.ActivityData.type == "offerMinusCoupons" || this.ActivityData.type == "offerFoldCoupons" ||
					this.ActivityData.type == "offerCoinCoupons") {
					// 优惠券就不用遍历门店id了
					this.ActivityData.periodDay = this.SelectMenDianIdList.join(",")
					this.ActivityData.storeId = null
					this.Save()
				} else {
					this.SelectMenDianIdList.forEach(item => {
						setTimeout(() => {
							this.ActivityData.storeId = item
							this.Save()
						}, 200)
					})
				}
			},
			Save() {
				let this_ = this
				let list1 = this.MenDian.split(',')


				let ActivityData = JSON.parse(JSON.stringify(this.ActivityData))
				let ActivityRule = JSON.parse(JSON.stringify(this.ActivityRule))
				let ShanPinList = []
				try {
					ShanPinList = this.$refs.SheZhiZheKou.getShanPinList()
				} catch (e) {
					//TODO handle the exception
				}

				if (ActivityData.activityName == "") {
					uni.showModal({
						content: "请填写活动名称"
					})
					return;
				}

				if (this.Isvipactive) {
					// 会员活动
					ActivityRule.level = -1
					ActivityRule.operationType = "增"
					ActivityRule.thresholdUnit = "额"
					ActivityData.discount = "Full_amount" // 满额满减
					ActivityData.target = "vip"
					ActivityRule.ruleField = this.VipMoney + ":" + this.VipFen

					ActivityData.yzsActivityRuleList.push(ActivityRule)
				}

				if (ActivityData.type == "specialActivity" && ShanPinList.length != 0) {
					// 特价活动特殊处理

					if (ActivityData.joinType == "id" && ShanPinList.length != 0) {
						let joinList = []
						ActivityData.yzsActivityRuleList = []

						ShanPinList.forEach(item => {
							item.presentType = "特价活动，" + item.id + "商品打" + item.LinSouJia + "折"
							item.ruleField = item.LinSouJia / 10 // 折扣数
							item.presentId = item.id // 商品id


							joinList.push(item.id)


						})

						ActivityData.yzsActivityRuleList = ShanPinList
						ActivityData.joinList = joinList.join(',')



					} else {
						uni.showToast({
							title: '请先选择特价活动商品',
							icon: 'none'
						});
						return;
					}

				} else if (ActivityData.type == "discount") {
					// 特价活动只有不参与商品
					if (this.QCZheKou == null) {
						uni.showToast({
							title: '请先填写折扣率',
							icon: 'none'
						});
						return;
					}
					console.log('!!!', ActivityData)
					if (!ActivityData.yzsActivityRuleList[0]) {
						ActivityData.yzsActivityRuleList.push({
							thresholdUnit: '', //满额单位：记录满额的单位，如 "额" 或 "件
							operationType: '', // 操作类型: 表示操作类型，如减（满减）、折（满折）或增（满赠）
							ruleField: '', //  规则字段：记录具体的规则字段，如 "10:10" 表示满10加10分
							level: '', // 层级：表示第几层级
						})
					}
					let BuyActivityList = JSON.parse(JSON.stringify(ActivityData.yzsActivityRuleList[0]))


					// let joinList = []
					// if (ShanPinList.length != 0) {
					// 	ShanPinList.forEach(item => {
					// 		joinList.push(item.id)
					// 	})
					// 	ActivityData.unjoinList = joinList.join(',')
					// }
					// ActivityData.joinType = "all"
					ActivityData.discount = this.QCZheKou / 10


					if (this.SelectYouHuiQuan == 1) {
						//  满额券
						BuyActivityList.thresholdUnit = "满额"
					} else if (this.SelectYouHuiQuan == 2) {
						//  满件券
						BuyActivityList.thresholdUnit = "满件"
					}
					BuyActivityList.ruleField = this.QCMenKan

					// 发放方式
					ActivityData.yzsActivityRuleList = []
					ActivityData.yzsActivityRuleList.push(BuyActivityList)

				}
				if (ActivityData.type == "FullMinusActivity" || ActivityData.type == "fullFoldActivity" ||
					ActivityData.type == "offerMinusCoupons" || ActivityData.type == "offerCoinCoupons" ||
					ActivityData.type == "offerFoldCoupons" ||
					ActivityData.type == "vip_active" || ActivityData.type == "BuyActivity" || ActivityData.type ==
					"discount") {
					// 满额满级活动，对商品进行限制

					if (ActivityData.joinType == "id" && ShanPinList.length != 0) {
						let joinList = []
						ShanPinList.forEach(item => {
							joinList.push(item.id)
						})
						ActivityData.joinList = joinList.join(',')
					}
					if (ActivityData.unjoinType == "id" && ShanPinList.length != 0) {
						let joinList = []
						ShanPinList.forEach(item => {
							joinList.push(item.id)
						})
						ActivityData.unjoinList = joinList.join(',')
					}
				}

				console.log(1111, ActivityData);
				if (ActivityData.type == "BuyActivity") {

					let BuyActivityList = JSON.parse(JSON.stringify(ActivityData.yzsActivityRuleList[0]))
					// let BuyActivityList =  ActivityData.yzsActivityRuleList[0]


					BuyActivityList.thresholdUnit = this.ChoiseBuyGoods.id
					BuyActivityList.presentId = this.ChoiseSonGoods.id
					BuyActivityList.operationType = this.ZheKouNumber / 10
					BuyActivityList.ruleField = this.BuyNumber + ":" + this.YouHuiNumber
					BuyActivityList.presentType = "买" + this.BuyNumber + "件" + this.ChoiseBuyGoods.name + "，" +
						this
						.YouHuiNumber + "件" + this.ChoiseSonGoods.name + "打" + this.ZheKouNumber + "折"
					BuyActivityList.level = 1

					if (ActivityData.yzsActivityRuleList.length != 0) {
						BuyActivityList.relatedId = ActivityData.yzsActivityRuleList[0].relatedId
						BuyActivityList.ruleId = ActivityData.yzsActivityRuleList[0].ruleId
					}


					ActivityData.yzsActivityRuleList = []
					ActivityData.yzsActivityRuleList.push(BuyActivityList)
				}





				if (ActivityData.type == "offerMinusCoupons" ||
					ActivityData.type == "offerFoldCoupons" || ActivityData.type == "offerCoinCoupons") {
					// 满减券、折扣券
					let BuyActivityList = {};
					if (ActivityData.yzsActivityRuleList.length == 0) {
						BuyActivityList = {}
					} else {
						BuyActivityList = ActivityData.yzsActivityRuleList[0]
					}
					BuyActivityList.presentType = this.YonQuanTimeDesc
					if (this.YonQuanTime == 1) {
						// 指定时间可用
						BuyActivityList.presentId = this.YonQuanTime
					} else if (this.YonQuanTime == 2) {
						BuyActivityList.presentId = this.YonQuanTime + "&" + this.LinQuHouWaitTime + ":" + this
							.YouXiaoQiTime

					} else if (this.YonQuanTime == 0) {
						BuyActivityList.presentId = this.YonQuanTime + "&" + this.LinQuHouTime
					}
					BuyActivityList.level = this.FaXinNumber
					ActivityData.discount = this.FaFanType

					if (this.FaFanType.indexOf("AfterRecharge") != -1) {
						ActivityData.periodType = this.ChonZhiPrice
					}

					ActivityData.updateBy = this.ChonZhiNum




					if (ActivityData.type == "offerMinusCoupons" ||
						ActivityData.type == "offerFoldCoupons") {


						if (this.SelectYouHuiQuan == 1) {
							//  满额券
							BuyActivityList.thresholdUnit = "满额"
						} else if (this.SelectYouHuiQuan == 2) {
							//  满件券
							BuyActivityList.thresholdUnit = "满件"
						}

						if (ActivityData.type == "offerFoldCoupons") {
							// 折扣券
							BuyActivityList.ruleField = this.MenKanMoney + ":" + (Number(this.QuanMianMoney) / 10)
								.toString()
							BuyActivityList.operationType = "折"
						} else {
							// 满减券
							BuyActivityList.operationType = "减"
							BuyActivityList.ruleField = this.MenKanMoney + ":" + this.QuanMianMoney
						}
						// 发放方式
						ActivityData.yzsActivityRuleList = []
						ActivityData.yzsActivityRuleList.push(BuyActivityList)
					}
					if (ActivityData.type == "offerCoinCoupons") {

						let DuiHuanList = this.$refs.SheZhiZheKou.getShanPinList()
						if (DuiHuanList.length == 0) {
							uni.showModal({
								content: "请选择兑换商品"
							})
							return;
						}
						let idString = ""
						let idList = []
						// let DuiHuanList2 = []
						DuiHuanList.forEach(item => {
							idList.push(item.id)
							// DuiHuanList2.push(item.name)
						})
						idString = idList.join(",")

						BuyActivityList.operationType = idString
						BuyActivityList.ruleField = this.DuiHuanNumber
						BuyActivityList.thresholdUnit = "兑换"
						// BuyActivityList.operationType = "可兑换商品：" + DuiHuanList2.join(",")
						ActivityData.yzsActivityRuleList = []
						ActivityData.yzsActivityRuleList.push(BuyActivityList)

					}
				}








				console.log(ActivityData)


				uni.showLoading({
					title: '正在保存...'
				});
				this.$request(this.$api.Activity, ActivityData, "POST", false).then(res => {
					uni.hideLoading();
					if (res.code == '200') {
						uni.showToast({
							title: '创建成功！'
						});
						this.countSave++

						if (this.countSave == 1) {
							setTimeout(() => {

								let pages = getCurrentPages(); // 当前页面
								let beforePage = pages[pages.length - 2]; // 上一页
								uni.navigateBack({
									success: function() {
										let a = {}
										a.type = 'Active'
										beforePage.onLoad(a); // 执行上一页的onLoad方法
									}
								});
							}, 1000)
						}


					} else {

						uni.showToast({
							title: res.message,
							icon: 'error'
						});
					}
				})

			},

			IsRuKuReq() {
				let this_ = this
				let ShanPinList = this.$refs.SheZhiZheKou1.getShanPinList()
				if (ShanPinList.length == 0) {
					uni.showToast({
						title: "商品列表为空",
						icon: 'none'
					});
					return;
				}
				ShanPinList.forEach(item => {
					item.storeId = uni.getStorageSync("SelectMenDian")
					item.goodsId = item.id
					item.costPrice = item.JinHuoJia
					item.number = item.RuKuNum
					item.salePrice = item.LinSouJia
					item.remark = this_.remark
				})
				uni.showLoading({
					title: '加载中'
				});
				this.$request(this.$api.businessgoods, ShanPinList, "POST", false).then(res => {
					uni.hideLoading();
					if (res.code == '200') {
						uni.showLoading({
							title: '创建成功！'
						});
						setTimeout(() => {
							let pages = getCurrentPages(); // 当前页面
							let beforePage = pages[pages.length - 2]; // 上一页
							uni.navigateBack({
								success: function() {
									let a = {}
									a.type = 'RuKu'
									beforePage.onLoad(a); // 执行上一页的onLoad方法
								}
							});
						}, 1000)

					} else {
						uni.showToast({
							title: "错误",
							icon: 'error'
						});
					}
				})
			},


			radioMenDianChange(e) {
				if (e.target.value == 'ZhiDingMenDian') {
					this.ZhiDinMenDian = true
					this.SelectMenDianIdList = []

					let MenDianObj = uni.getStorageSync("MenDianList")
					console.log(MenDianObj)
					this.SelectMenDianIdList.push(this.ActivityData.storeId)
					MenDianObj.forEach(item => {
						if (uni.getStorageSync("SelectMenDian") == item.id) {
							this.MenDian = item.name
						}
					})
				} else {
					this.ZhiDinMenDian = false
					this.SelectMenDianIdList = []

					let MenDianObj = uni.getStorageSync("MenDianList")
					MenDianObj.forEach(item => {
						this.SelectMenDianIdList.push(item.id)
					})
				}
				console.log(this.SelectMenDianIdList)
			},
			DuiXiangRadio(e) {
				this.ActivityData.target = e.target.value
			},
			JiFenRadio(e) {
				this.ActivityData.earnPoints = e.target.value
			},
			YonQuanTimeRadio(e) {
				this.YonQuanTime = e.target.value
				console.log(e);
			},
			ShowMomo() {
				this.show = !this.show

			},
			ShowMomo1() {
				this.show1 = !this.show1
			},
			ShowMomo2() {
				this.show2 = !this.show2
			},
			ShowMenDianMomo() {
				this.showMenDian = !this.showMenDian
			},
			goodsTypeQuery() { // 类别
				this.list = []
				this.list1 = []
				this.$request(this.$api.goodsTypeQuery, null, "POST", false).then(res => {

					if (res.code == '0') {
						res.data.forEach(i => {
							let a = {
								"value": i.id,
								"label": i.name,
							}
							this.list.push(a)
							this.list1.push(a)
						})
					} else {
						uni.showToast({
							title: "错误",
							icon: 'error'
						});
					}
				})
			},
			// 确定事件
			confirm(data) {
				this.ActivityData.joinList = data.map((el) => el.value).join(",");
				this.info = data.map((el) => el.label).join(",");
			},
			confirm1(data) {
				this.info1 = data.map((el) => el.label).join(",");
				this.ActivityData.unjoinList = data.map((el) => el.value).join(",");
			},
			confirm2(data) {
				// 优惠券发放方式
				let list2 = data.map((el) => el.value)

				this.info2 = data.map((el) => el.label).join(",");
				this.FaFanType = data.map((el) => el.value).join(",");
				if (this.FaFanType.indexOf("AfterRecharge") != -1) {
					this.ShowChonZhi = true
				} else {
					this.ShowChonZhi = false
				}
			},

			confirmMenDian(data) {
				// 门店多选
				let mendianlist = data.map((el) => el.value)
				if (mendianlist.length == 0) {
					uni.showModal({
						content: "至少选择一个门店！"
					})
					return;
				}
				this.MenDian = data.map((el) => el.label).join(",");
				this.SelectMenDianIdList = mendianlist

			},
			PiLiangButton() {
				this.ShowPiLiang = true
				this.$refs.SheZhiZheKou.PiLiangSetCode()
			},
			CancelPiLiangButton() {
				this.ShowPiLiang = false
			},
			changeSelectZhouQi() {
				if (this.SelectZhouQi == 3) { // 每月执行

					this.ShowZhiXinRiQi = true
					this.priceList = []
					for (let i = 1; i < 32; i++) {
						this.priceList.push(i)
					}
					this.ActivityData.periodType = "month"

				} else if (this.SelectZhouQi == 2) { // 每周执行
					this.ShowZhiXinRiQi = true
					this.priceList = []
					this.priceList = ['周一', '周二', '周三', '周四', '周五', '周六', '周日', ]
					this.ActivityData.periodType = "week"
				} else { // 每天执行
					this.ShowZhiXinRiQi = false
					this.ActivityData.periodType = "day"
				}
			},
			changeYouHuiQuan() {
				if (this.SelectYouHuiQuan == 1) {
					// 满指定金额优惠
				} else {
					// 满指定件数优惠

				}

			},
			changeSelectJoin() {
				if (this.SelectJoin == 3) {
					this.ShowNOJoin = false
					this.ShowFenLei = false
					this.ShowFenLei1 = false
					this.ZhiDingShangPing = true
					this.SelectJoin1 = 1 // 不参与商品无
					this.ActivityData.joinType = "id"
					this.ShowSheZhiZheKou = false
					this.info = null
					this.ActivityData.unjoinType = "none"
					this.ActivityData.unjoinList = ""

				} else if (this.SelectJoin == 2) {
					this.ShowFenLei = true
					this.ZhiDingShangPing = false
					this.ShowNOJoin = true // 不参与商品
					this.ActivityData.joinType = "type"

				} else { // 全部商品参加
					this.ShowFenLei = false
					this.ShowFenLei1 = false
					this.ShowNOJoin = true
					this.ZhiDingShangPing = false
					this.ActivityData.joinType = "all"

					this.info = null
				}
			},
			changeSelectJoin1() {
				if (this.SelectJoin1 == 3) {
					this.ZhiDingShangPing = true // 指定商品
					// this.SelectJoin = 1 // 参与商品全部
					this.ShowFenLei1 = false // 指定id
					this.ActivityData.unjoinType = "id"
					this.info1 = null
					this.ShowSheZhiZheKou = true


				} else if (this.SelectJoin1 == 2) {
					this.ShowFenLei1 = true
					this.ZhiDingShangPing = false
					this.ActivityData.unjoinType = "type"
					this.ShowSheZhiZheKou = false

					this.$refs.SheZhiZheKou.setShanPinList([])

				} else { // 无不参与商品
					this.ZhiDingShangPing = false
					this.ShowFenLei1 = false
					this.ActivityData.unjoinType = "none"
					this.info1 = null
					this.ShowSheZhiZheKou = false

					if (this.ActivityData.joinType = "id" || this.ActivityData.joinType != "type") {
						this.$refs.SheZhiZheKou.setShanPinList([])
						this.$refs.SheZhiZheKou1.setShanPinList([])
					}

				}
			},
			onClickItem(e) { // 切换
				if (this.current != e.currentIndex) {
					this.current = e.currentIndex;
				}
			},
			ManJianClick() {
				uni.navigateTo({
					url: "/pages/promotion/NextBuZhou/ManJian?type=" + this.ActivityData.type,
				})
			},
			ChangeYouHuiNeiRong() {

			},
			NextBuZhou() {
				if (this.IsRuKu) {
					uni.navigateTo({
						url: "/pages/promotion/NextBuZhou/NextBuZhou?type=RuKu",
					})
				} else {
					uni.navigateTo({
						url: "/pages/promotion/NextBuZhou/NextBuZhou?type=" + this.ActivityData.type,
					})
				}

			},
			ShowHuoDonFanWei() {
				this.Pop1List = [{
						name: '特价活动',
						value: 'specialActivity',
						id: 1
					},
					{
						name: '折扣活动',
						value: 'discount',
						id: 2
					},
					{
						name: '满减券',
						value: 'offerMinusCoupons',
						id: 3
					},
					{
						name: '折扣券',
						value: 'offerFoldCoupons',
						id: 4
					},
					{
						name: '兑换券',
						value: 'offerCoinCoupons',
						id: 5
					},
					{
						name: '满N元减/送',
						value: 'FullMinusActivity',
						id: 6
					},
					{
						id: 7,
						name: '满N件减/送',
						value: 'FullMinusActivity',
					},
					{
						id: 8,
						name: '满N元折/送',
						value: 'fullFoldActivity'
					},
					{
						id: 9,
						name: '满N件减/送',
						value: 'fullFoldActivity'
					},
					{
						id: 10,
						name: '第二件半价',
						value: 'BuyActivity'
					},
					{
						id: 11,
						name: '买一送一',
						value: 'BuyActivity'
					},
					{
						id: 12,
						name: '自定义优惠',
						value: 'BuyActivity'
					}, {
						id: 13,
						name: '会员活动',
						value: 'vip_active'
					},
				]

				this.$refs.popup1.open('bottom')
			},
			PopCancel() {
				this.$refs.popup.close()
			},
			Pop1Cancel() {
				this.$refs.popup1.close()
			},
			ShowYouHuiXianGou() {
				this.$refs.popup.open('bottom')
			},
			ShowHuoDonPop() {
				this.$refs.popup2.open('bottom')
			},
			DateChange(e) {
				this.ActivityData.startTime = e.detail.value
			},
			DateChangeend(e) {
				this.ActivityData.endTime = e.detail.value
			},
			bindDateChange(e) {
				this.ActivityData.startTime = e.target.value
				var time = Date.parse(this.ActivityData.startTime)
				this.coupon_form.start_time = time / 1000 //获取时间戳
			},
			bindDateChange_end(e) {
				this.ActivityData.endTime = e.target.value
				var time = Date.parse(this.ActivityData.endTime)
				this.coupon_form.end_time = time / 1000
			},
			//-----------------------------------------------------------优惠券开始日期
			getDate(type) {
				const date = new Date();
				let year = date.getFullYear();
				let month = date.getMonth() + 1;
				let month_end = date.getMonth() + 2;
				let day = date.getDate();

				if (type === 'start') {
					year = year - 60;
				} else if (type === 'end') {
					year = year + 2;
				}
				month = month > 9 ? month : '0' + month;;
				day = day > 9 ? day : '0' + day;
				return `${year}-${month}-${day}`;
			},
			//-----------------------------------------------------优惠券结束时间
			getDate_end(type) {
				const date = new Date();
				let year = date.getFullYear();
				let month = date.getMonth() + 2;
				let day = date.getDate(); /*  */

				if (type === 'start') {
					year = year - 60;
				} else if (type === 'end') {
					year = year + 20;
				}
				month = month > 9 ? month : '0' + month;;
				day = day > 9 ? day : '0' + day;

				return `${year}-${month}-${day}`;
			},

			ChangePop(item) {
				this.YouHuiXianGou = item.name
				this.$refs.popup.close()
			},
			ChangePop1(item) {
				this.HuoDonTip = item.name
				this.ActivityData.type = item.value
				this.ToOption(item.value, item.name)
				this.$refs.popup1.close()
			},

		},
	}
</script>

<style lang="scss" scoped>
	.PopDiv {
		width: 86vw;
		background-color: #fff;
		min-height: 30vh;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		border-radius: 11rpx;
		padding-top: 56rpx;

		.PopItem {
			height: 95rpx;
			display: flex;
			justify-content: center;
			align-items: center;
			width: 100%;
			/* border-bottom: 4rpx solid #f0f0f0; */
			font-size: 32rpx;
			background-color: #e4e5e7;
			width: 54vw;
			border-radius: 20vw;
			margin-bottom: 25rpx;
		}

		.PopButton {
			width: 50%;
			text-align: center;
			height: 60rpx;
			display: flex;
			align-items: center;
			justify-content: center;
			font-weight: 600;
			font-size: 30rpx;
		}

		.PopTitle {
			margin-bottom: 32rpx;
			font-size: 34rpx;
			font-weight: 600;
		}

		.PopCenterDiv {
			width: 100%;

			.RadioGroup2 {
				flex-direction: column;
				display: flex;
				align-items: center;
				width: 100%;

				.radio1 {
					display: flex;
					align-items: center;
					height: 100rpx;
					width: 90%;
					font-size: 28rpx;

					.radioItemDiv {
						display: flex;
						align-items: center;
					}
				}

				.RadioInput {
					background: #f6f6f6;
					width: 200rpx;
					height: 70rpx;
					text-align: center;
				}
			}
		}

		.PopButtonDiv {
			width: 100%;
			height: 100rpx;
			display: flex;
			align-items: center;
			justify-content: center;
			border-top: 2rpx solid #e4e6e5;
			margin-top: 20rpx;
		}

	}


	.JinErTime {
		width: 70vw;
		display: flex;
		align-items: center;

		.JinErStart {
			width: 250rpx;
			display: flex;
			justify-content: center;
			align-items: center;
			margin-right: 10rpx;

			/deep/ .uni-easyinput__content input {
				padding-left: 0 !important;
				padding-right: 8px !important;
			}
		}
	}

	.JinErStart {
		width: 250rpx;
		display: flex;
		justify-content: center;
		align-items: center;
		margin-right: 10rpx;

		/deep/ .uni-easyinput__content input {
			padding-left: 0 !important;
			padding-right: 8px !important;
		}
	}

	.ZhouQiStart {

		width: 155rpx;
		display: flex;
		justify-content: center;

	}

	.ZhouQiTime {
		display: flex;
		align-items: center;
	}

	.ZhouQiAdd {
		margin-right: 33rpx;
		color: #1f64ff;
	}

	.PopIndex1 {
		max-height: 60vh;
		overflow-y: scroll;
	}

	.ButtonImage {
		width: 42rpx;
		height: 42rpx;
	}

	.SetShanPingBotton {
		display: flex;
		justify-content: center;
		align-items: center;
		width: 100%;
		gap: 3vw;
		padding-bottom: 23rpx;
	}

	/* 	.SetShanPingBotton button::after{
		border: 2rpx solid #2275c5 !important;
	} */

	.SetFirstButton {
		background-color: white !important;
		color: #007afc !important;
		border: 2rpx solid #007afc !important;
		border-radius: 0 !important;
	}

	.SetLastButton {
		background-color: #007afc !important;
		color: white;
	}

	.SetLastButton,
	.SetFirstButton {
		width: 46%;
		font-size: 30rpx;
		margin: 0;
		display: flex;
		justify-content: center;
		align-items: center;
		padding: 0;
		border-radius: 0 !important;
	}


	.SetShanPing {
		width: 100% !important;
	}

	/deep/ .select-picker-border {
		border: 0 !important;
	}

	.RadioDev {
		padding-right: 40rpx !important;
	}

	.RadioGroup {
		text-indent: initial;
		font-size: 28rpx;
		display: flex;
		gap: 54rpx;
		align-items: center;
	}

	radio {
		transform: scale(0.8);
	}

	.radio {
		display: flex;
		align-items: center;
	}

	.ItemDiv {

		/deep/ .uni-easyinput__content input {
			text-align: right;
			padding-right: 24px !important;
		}

		/deep/ .is-input-border {
			border: 0 !important;
			background: none !important;
		}
	}

	/deep/ .is-input-border {
		border: 0 !important;
		background: none !important;
	}

	/deep/ .segmented-control__item--text {
		font-weight: 600;
		font-size: 32rpx !important;
	}

	/deep/ .segmented-control {

		background: #1f64ff !important;
		height: 107rpx !important;
	}

	/deep/ .segmented-control__text {
		/* font-size: 30rpx !important; */
		padding: 15rpx 0 !important;
	}

	.SearchDiv {
		display: flex;
		flex-direction: column;
		justify-content: center;
		position: fixed;
		top: 0;
		width: 100%;
		z-index: 6;
	}

	.content {
		padding-top: 107rpx;
		padding-bottom: 12vh;
	}


	.Pop2Index {
		margin: 0 4vw 0 4vw;
		height: 59vh;
		overflow-y: scroll;
	}

	.PopItem2Title {
		color: #979797;
		margin-top: 59rpx;
		margin-bottom: 20rpx;
		font-size: 26rpx;
	}

	.PopItem2 {
		margin-bottom: 6vh;
	}

	.PopItemTip {
		display: flex;
		justify-content: center;
		align-items: center;
		width: 27.3vw;
		height: 50rpx;
		background: #f7f7f7;
		border-radius: 5rpx;
		font-size: 26rpx;
		margin-bottom: -2vw;
	}

	.PopItemTipDiv {
		display: flex;
		flex-wrap: wrap;
		/* flex-direction: column; */
		align-items: center;
		gap: 5vw;
	}

	.uni-popup__wrapper {
		background: none !important;
	}


	.PopItem {
		height: 100rpx;
		display: flex;
		justify-content: center;
		align-items: center;
		width: 100%;
		border-bottom: 4rpx solid #f0f0f0;
		font-size: 31rpx;
	}

	.PopCancel {
		height: 90rpx;
		display: flex;
		justify-content: center;
		align-items: center;
		width: 100%;
		border-top: 14rpx solid #f0f0f0;
		font-size: 31rpx;
	}

	.ItemDev {
		padding-right: 41px;
	}

	.SmallTip {
		color: #89898b;
		width: 100%;
		text-align: left;
		margin-left: 40rpx;
		margin-top: 10rpx;
		margin-bottom: -5rpx;
	}

	.main {
		background-color: #f0f1f5;
		min-height: 100vh;
	}

	/* 	.vue-ref{
		    border-top-left-radius: 5vw;
		    border-top-right-radius: 5vw;
	} */


	.ShanPinImg {
		width: 100vw;
	}

	.RightImg {
		width: 30rpx;
		height: 30rpx;
		position: absolute;
		right: 39rpx;
	}

	/deep/ picker {
		padding-right: 41px;
	}

	.CanCelButton {
		height: 76rpx;
		display: flex;
		align-items: center;
		justify-content: center;
		flex: 1;
		border: 2rpx solid #1d77c2;
		color: #1d77c2 !important;
		border-radius: 0 !important;
		background-color: white !important;
		font-size: 0.9rem;
		text-align: center;
	}

	.OutLoginButton1 {
		height: 76rpx;
		display: flex;
		align-items: center;
		justify-content: center;
		flex: 1;
		color: rgba(255, 255, 255, 1) !important;
		background-color: #007afc !important;
		border-radius: 0 !important;
		font-size: 0.9rem;
		text-align: center;

	}

	.uni-searchbar__text-placeholder {
		font-size: 22rpx;
	}

	.OutLogin {
		width: 100%;
		position: fixed;
		bottom: 0;
		display: flex;
		justify-content: center;
		align-items: center;
		align-content: center;
		padding-top: 18rpx;
		padding-bottom: 38rpx;
		background: white;
		gap: 2vw;
		/* left: 2vw; */
	}

	.ItemTitle {
		display: flex;
		align-items: center;
	}

	.SmallIcon {
		color: red;
	}

	.SelectPhotoSVG {
		width: 66rpx;
		height: 66rpx;

		font-size: 82rpx;
		color: rgba(153, 153, 153, 0.5285714285714286);
	}

	.ShowButtomBig {
		top: 0rpx;
		left: 0;
		position: absolute !important;
		width: 100vw;
		height: 30vh !important;

		display: flex !important;
		flex-direction: column !important;
		align-items: center !important;
		justify-content: center !important;
		overflow: visible !important;
	}

	.SelectPhotoText,
	.ShowButtomBig,
	.GuDing,
	.SelectPhotoSVG {
		pointer-events: none !important;
	}

	.file-image {
		/* display: none; */
	}

	.SelectPhotoText {

		color: rgba(215, 215, 215, 1);
		font-size: 18rpx;
		line-height: 150%;
		text-align: center;
		margin-top: 4rpx;
	}

	.uni-file-picker__container {
		display: flex;
		align-items: center;
		justify-content: center;
		margin: 0 !important;
		/* height: 34vh; */
	}

	.file-picker__box-content {
		position: static !important;
	}

	.file-picker__box-content {
		width: 100vw !important;
		height: 30vh !important;

		margin: 0 !important;
	}

	.uni-file-picker {
		background-color: rgba(204, 204, 204, 1);
		/* background-image: url("@/static/Index/My.png"); */
		z-index: -1;
		height: 30vh !important;
	}

	.file-picker__box {
		display: flex;
		align-items: center;
		justify-content: center;
		width: 100% !important;
		height: 30vh !important;
	}

	.XuanZeDiv,
	.ShowBottom {
		width: 166rpx;
		height: 166rpx;

		color: rgba(80, 80, 80, 1);
		background-color: rgba(0, 0, 0, 0.6);


		border-radius: 50% !important;
		display: flex !important;
		flex-direction: column !important;
		align-items: center !important;
		justify-content: center !important;
		overflow: visible !important;
	}

	.SelectDiv .uni-select__input-text {
		/* width: 90% !important; */
	}

	.SelectDiv .uniui-bottom {
		position: relative;
		right: 10rpx;
	}

	.ComboxClass {
		width: 80% !important;
	}

	.SetShanPingDiv {
		display: flex;
		flex-direction: column;
		align-items: center;
	}

	.MenuDiv {
		display: flex;
		flex-direction: column;
		align-items: center;
		gap: 20rpx;
		padding-top: 10rpx;
	}

	.SaoMiao {
		margin-right: 46rpx;
	}

	.ItemDiv {
		display: flex;
		align-items: center;
		justify-content: space-between;

		text-indent: 24rpx;
		color: rgba(80, 80, 80, 1);
		font-size: 0.9rem;
		text-align: left;
		background-color: white;
		width: 95%;
		min-height: 82rpx;
		border-radius: 10rpx;
	}

	.SaoMiaoDiv {

		justify-content: space-between;
	}

	.SaoMiao image {
		width: 40rpx;
		height: 40rpx;
	}

	.uni-combox {
		border: 0 !important;
	}

	.uni-combox__input-plac {
		font-size: 24rpx !important;
	}

	.uni-select {
		border: 0 !important;
	}
</style>